using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._EditingTools._Conflation
{
    /// <summary>
    /// <para>Transform Features</para>
    /// <para>Converts the coordinates of input features from one location to another through scaling,  
    /// shifting, and rotating based on the transformation links between known corresponding control points.</para>
    /// <para>通过缩放将输入要素的坐标从一个位置转换为另一个位置，
    /// 根据已知相应控制点之间的变换链路进行移位和旋转。</para>
    /// </summary>    
    [DisplayName("Transform Features")]
    public class TransformFeatures : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public TransformFeatures()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input features, the coordinates of which are to be transformed. They can be points, lines, polygons, or annotations.</para>
        /// <para>输入要素，其坐标将被变换。它们可以是点、线、多边形或注释。</para>
        /// </param>
        /// <param name="_in_link_features">
        /// <para>Input Link Features</para>
        /// <para>The input link features that link known control points for the transformation.</para>
        /// <para>输入链接用于转换的已知控制点的功能。</para>
        /// </param>
        public TransformFeatures(object _in_features, object _in_link_features)
        {
            this._in_features = _in_features;
            this._in_link_features = _in_link_features;
        }
        public override string ToolboxName => "Editing Tools";

        public override string ToolName => "Transform Features";

        public override string CallName => "edit.TransformFeatures";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_in_features, _in_link_features, _method.GetGPValue(), _out_link_table, _out_rmse, _out_feature_class];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input features, the coordinates of which are to be transformed. They can be points, lines, polygons, or annotations.</para>
        /// <para>输入要素，其坐标将被变换。它们可以是点、线、多边形或注释。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Input Link Features</para>
        /// <para>The input link features that link known control points for the transformation.</para>
        /// <para>输入链接用于转换的已知控制点的功能。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Link Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_link_features { get; set; }


        /// <summary>
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the transformation method to use to convert input feature coordinates.</para>
        ///   <bulletList>
        ///     <bullet_item>Affine transformation—Affine transformation requires a minimum of three transformation links. This is the default.</bullet_item><para/>
        ///     <bullet_item>Projective transformation—Projective transformation requires a minimum of four transformation links.</bullet_item><para/>
        ///     <bullet_item>Similarity transformation—Similarity transformation requires a minimum of two transformation links.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于转换输入要素坐标的变换方法。</para>
        ///   <bulletList>
        ///     <bullet_item>仿射变换 - 仿射变换至少需要三个变换链接。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>投影变换 - 投影变换至少需要四个变换链接。</bullet_item><para/>
        ///     <bullet_item>相似性变换 - 相似性变换至少需要两个变换链接。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _method_value _method { get; set; } = _method_value._AFFINE;

        public enum _method_value
        {
            /// <summary>
            /// <para>Affine transformation</para>
            /// <para>Affine transformation—Affine transformation requires a minimum of three transformation links. This is the default.</para>
            /// <para>仿射变换 - 仿射变换至少需要三个变换链接。这是默认设置。</para>
            /// </summary>
            [Description("Affine transformation")]
            [GPEnumValue("AFFINE")]
            _AFFINE,

            /// <summary>
            /// <para>Projective transformation</para>
            /// <para>Projective transformation—Projective transformation requires a minimum of four transformation links.</para>
            /// <para>投影变换 - 投影变换至少需要四个变换链接。</para>
            /// </summary>
            [Description("Projective transformation")]
            [GPEnumValue("PROJECTIVE")]
            _PROJECTIVE,

            /// <summary>
            /// <para>Similarity transformation</para>
            /// <para>Similarity transformation—Similarity transformation requires a minimum of two transformation links.</para>
            /// <para>相似性变换 - 相似性变换至少需要两个变换链接。</para>
            /// </summary>
            [Description("Similarity transformation")]
            [GPEnumValue("SIMILARITY")]
            _SIMILARITY,

        }

        /// <summary>
        /// <para>Output Link Table</para>
        /// <para>The output table containing input links and their residual errors.</para>
        /// <para>包含输入链接及其残差的输出表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Link Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_link_table { get; set; } = null;


        /// <summary>
        /// <para>RMSE</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("RMSE")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double _out_rmse { get; set; }


        /// <summary>
        /// <para>Updated Input Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_feature_class { get; set; }


        public TransformFeatures SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}